Skip to content

Conversation

jonastheis
Copy link
Contributor

@jonastheis jonastheis commented Aug 14, 2025

This PR introduces a test can_reject_l2_block_with_unknown_l1_message. It verifies that a follower node correctly rejects L2 blocks containing L1 messages it hasn't received yet.

Test scenario:

  1. Sets up two nodes: a sequencer and a follower
  2. The sequencer builds 10 initial blocks that are successfully imported by the follower
  3. An L1 message is sent only to the sequencer (not to the follower)
  4. The sequencer includes this L1 message in block 11 and continues building blocks up to block 15
  5. The follower detects the unknown L1 message and stops processing at block 10, refusing to import blocks 11-15
  6. Once the L1 message is finally sent to the follower, it can process the previously rejected blocks
  7. The test confirms both nodes are synchronized at block 16 after the follower catches up

Key verification points:

  • The follower correctly identifies missing L1 messages with a L1MessageMissingInDatabase event
  • Block processing halts at the last valid block (block 10) when an unknown L1 message is encountered
  • The follower can resume processing and catch up once it receives the missing L1 message
  • This ensures L2 chain consistency by preventing nodes from accepting blocks with L1 messages they cannot validate

This test is important for maintaining network security and preventing nodes from processing potentially invalid L1-L2
bridge transactions.

@jonastheis jonastheis changed the base branch from main to feat/e2e-tests-l1-message-reorg August 14, 2025 09:36
@jonastheis jonastheis changed the title Add test to check that L2 block with unknown L1 message is rejected Add test to check that L2 block with unknown L1 message is rejected by follower node Aug 14, 2025
@jonastheis jonastheis changed the title Add test to check that L2 block with unknown L1 message is rejected by follower node Add e2e test to check that L2 block with unknown L1 message is rejected by follower node Aug 14, 2025
Base automatically changed from feat/e2e-tests-l1-message-reorg to main August 28, 2025 07:00
@jonastheis jonastheis marked this pull request as ready for review August 29, 2025 02:19
@jonastheis jonastheis changed the title Add e2e test to check that L2 block with unknown L1 message is rejected by follower node feat(e2e test): check that L2 block with unknown L1 message is rejected by follower node Aug 29, 2025
frisitano
frisitano previously approved these changes Aug 29, 2025
@jonastheis jonastheis requested a review from frisitano September 1, 2025 01:52
@jonastheis jonastheis merged commit 892a314 into main Sep 1, 2025
13 checks passed
@jonastheis jonastheis deleted the feat/e2e-test-reject-l2-block-unknown-l1-message branch September 1, 2025 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants